package exception_homework2;

import java.io.IOException;

/**
 * 异常的抛出
 */
public class ThrowDemo2 {
    public static void main(String[] args) {
        System.out.println("程序开始了...");
        Student ls = new Student();
        try {
            ls.setAge(100);
            System.out.println(ls.getAge());
        }catch (RuntimeException e){
            System.out.println("年龄不合法");
        }
        System.out.println("程序结束了..");

    }
}
